package com.joysuch.wwyt.risk.entity;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

import static javax.persistence.GenerationType.IDENTITY;

@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Entity
@Table(name = "WWYT_RISK_DISTRICT_STABLE_EVALUTION")
@SQLDelete(sql = "update WWYT_RISK_DISTRICT_STABLE_EVALUTION set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update WWYT_RISK_DISTRICT_STABLE_EVALUTION set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")
public class RiskStableEvalution implements java.io.Serializable {
    //id
    private Long id;
    //区域风险评价id
  /*  private Long riskEvalutionId;
    //风险区域id
    private Long riskDistrictId;*/
    // 区域内火灾危险性类别
    private Integer areaCategory;
    // 化学品急性毒性危害类别
    private Integer chemicalCategory;
    // 危险工艺和重点监管危险化学品
    private Integer processAndChemical;
    // 工艺压力(p)
    private Integer processPressure;
    //工艺温度(t)
    private Integer processTemperature;
    // 重大生产安全事故隐患
    private Integer accident;
    //评估区域与周边相邻的不符合防火间距要求的其他区域（包括周边企业）现场人数之和
    private Integer peopleTotalNumber;
    //评估区域与周边相邻其他区域（包括周边企业）现场人数的最大值
    private Integer areaMaxNumber;
    // 所在企业任一装置设施类区域最大现场人数
    private Integer enterpriseMaxNumber;
    // 评估区域重大危险源等级
    private Integer maxLevel;
    //企业边界外500米范围内
    private Integer scope;
    // 风险等级
    private Integer riskLevel;
    // 创建人
    private java.lang.Long createBy;
    // 创建时间
    private java.util.Date createTime;
    // 更新人
    private java.lang.Long updateBy;
    // 更新时间
    private java.util.Date updateTime;
    // 删除标记
    private java.lang.String deleteFlag;
    // 组织机构代码
    private java.lang.String orgCode;
    // 租户
    private java.lang.Long tenentId;


    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

  /*  @Column(name = "RISK_EVALUTION_ID")
    public Long getRiskEvalutionId() {
        return riskEvalutionId;
    }

    public void setRiskEvalutionId(Long riskEvalutionId) {
        this.riskEvalutionId = riskEvalutionId;
    }

    @Column(name = "RISK_DISTRICT_ID")
    public Long getRiskDistrictId() {
        return riskDistrictId;
    }

    public void setRiskDistrictId(Long riskDistrictId) {
        this.riskDistrictId = riskDistrictId;
    }
*/
    @Column(name = "AREA_FIRE_RISK_CATEGORY")
    public Integer getAreaCategory() {
        return areaCategory;
    }

    public void setAreaCategory(Integer areaCategory) {
        this.areaCategory = areaCategory;
    }

    @Column(name = "CHEMICAL_TOXIC_HAZARD_CATEGORY")
    public Integer getChemicalCategory() {
        return chemicalCategory;
    }

    public void setChemicalCategory(Integer chemicalCategory) {
        this.chemicalCategory = chemicalCategory;
    }

    @Column(name = "PROCESS_AND_CHEMICAL")
    public Integer getProcessAndChemical() {
        return processAndChemical;
    }

    public void setProcessAndChemical(Integer processAndChemical) {
        this.processAndChemical = processAndChemical;
    }

    @Column(name = "PROCESS_PRESSURE")
    public Integer getProcessPressure() {
        return processPressure;
    }

    public void setProcessPressure(Integer processPressure) {
        this.processPressure = processPressure;
    }

    @Column(name = "PROCESS_TEMPERATURE")
    public Integer getProcessTemperature() {
        return processTemperature;
    }

    public void setProcessTemperature(Integer processTemperature) {
        this.processTemperature = processTemperature;
    }

    @Column(name = "ACCIDENT")
    public Integer getAccident() {
        return accident;
    }

    public void setAccident(Integer accident) {
        this.accident = accident;
    }

    @Column(name = "PEOPLE_TOTAL_NUMBER")
    public Integer getPeopleTotalNumber() {
        return peopleTotalNumber;
    }

    public void setPeopleTotalNumber(Integer peopleTotalNumber) {
        this.peopleTotalNumber = peopleTotalNumber;
    }

    @Column(name = "AREA_PEOPLE_MAX_NUMBER")
    public Integer getAreaMaxNumber() {
        return areaMaxNumber;
    }

    public void setAreaMaxNumber(Integer areaMaxNumber) {
        this.areaMaxNumber = areaMaxNumber;
    }

    @Column(name = "ENTERPRISE_PEOPLE_MAX_NUMBER")
    public Integer getEnterpriseMaxNumber() {
        return enterpriseMaxNumber;
    }

    public void setEnterpriseMaxNumber(Integer enterpriseMaxNumber) {
        this.enterpriseMaxNumber = enterpriseMaxNumber;
    }

    @Column(name = "MAX_LEVEL")
    public Integer getMaxLevel() {
        return maxLevel;
    }

    public void setMaxLevel(Integer maxLevel) {
        this.maxLevel = maxLevel;
    }

    @Column(name = "SCOPE")
    public Integer getScope() {
        return scope;
    }

    public void setScope(Integer scope) {
        this.scope = scope;
    }

    @Column(name = "RISK_LEVEL")
    public Integer getRiskLevel() {
        return riskLevel;
    }

    public void setRiskLevel(Integer riskLevel) {
        this.riskLevel = riskLevel;
    }

    @org.springframework.data.annotation.CreatedBy
    @Column(name = "CREATE_BY")
    public Long getCreateBy() {
        return createBy;
    }

    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }

    @org.springframework.data.annotation.CreatedDate
    @Column(name = "CREATE_TIME")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @org.springframework.data.annotation.LastModifiedBy
    @Column(name = "UPDATE_BY")
    public Long getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(Long updateBy) {
        this.updateBy = updateBy;
    }

    @org.springframework.data.annotation.LastModifiedDate
    @Column(name = "UPDATE_TIME")
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Column(name = "DELETE_FLAG")
    public String getDeleteFlag() {
        return deleteFlag;
    }

    public void setDeleteFlag(String deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    @Column(name = "ORG_CODE")
    public String getOrgCode() {
        return orgCode;
    }

    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }

    @Column(name = "TENENT_ID")
    public Long getTenentId() {
        return tenentId;
    }

    public void setTenentId(Long tenentId) {
        this.tenentId = tenentId;
    }

    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId()).append("areaCategory", getAreaCategory())
                .append("chemicalCategory", getChemicalCategory()).append("processAndChemical", getProcessAndChemical())
                .append("processPressure", getProcessPressure()).append("processTemperature", getProcessTemperature()).append("accident", getAccident())
                .append("peopleTotalNumber", getPeopleTotalNumber()).append("areaMaxNumber", getAreaMaxNumber())
                .append("enterpriseMaxNumber", getEnterpriseMaxNumber()).append("maxLevel", getMaxLevel())
                .append("scope", getScope()).append("riskLevel", getRiskLevel()).append("createBy", getCreateBy())
                .append("createTime", getCreateTime()).append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime()).append("deleteFlag", getDeleteFlag())
                .append("orgCode", getOrgCode()).append("tenentId", getTenentId()).toString();
    }
    public int hashCode() {
        return new HashCodeBuilder().append(getId()).toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof  RiskStableEvalution == false)
            return false;
        if (this == obj)
            return true;
        RiskStableEvalution other = ( RiskStableEvalution) obj;
        return new EqualsBuilder().append(getId(), other.getId()).isEquals();
    }

}
